home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44c.zip / RFR009.QM < prev    next >
Text File  |  1992-05-27  |  33KB  |  750 lines

  1. *                               rfr009.qm
  2. *                Macros To Sort and Convert Column Blocks
  3. *                        Written By Tom Hogshead
  4. *                       [ See RFRMxx.QM For Use ]
  5. *                                 5/30/92
  6. *  New                                                              Key  Macro
  7. *  Key       Subfile           Description                          Old  Status
  8. * =====  ==============  ========================================== ===  ======
  9. *                   Sort Column Block And Adjacent Text In:
  10. * @1                   --Ascending  Absolute Value  ( )             @f6
  11. * @2                   --Descending Absolute Value                  @f7
  12. * @3                   --Ascending, Case Insensitive                @9
  13. * @4                   --Descending                                 @f5
  14. * @5                   --Reverse                                    @8
  15. *
  16. *                   Sort Column Block Only In:
  17. * @6                   --Ascending  Absolute Value                  @5
  18. * @7                   --Descending Absolute Value                  @6
  19. * @8                   --Ascending, Limited to 999 Lines            @0
  20. * @9                   --Descending                                 @3
  21. * @0                   --Randomly                                   @4
  22. *
  23. *                   Convert Column Blocks:
  24. * #f1                  --Make Column Block to Test Macros           @f9
  25. * #f2                  --Test If Block Is Marked, and Close         ^2
  26. * #f3                  --Convert Vertical to Horizontal Column Block
  27. * #f4                  --Convert Horizontal to Vertical Column Block
  28. * #f5                  --Convert Vertical to Horizontal Column Block,
  29. *                        Horizontal Entries NOT Separated by Space
  30. * #f6                  --Convert Horizontal to Vertical Column Block,
  31. *                        Horizontal Entries NOT Separated by Space
  32. *
  33. *         {e:\up\RFRM*}--Return To RFRMxx.QM
  34. *
  35. *--eoi
  36.  
  37. *                            M A C R O S
  38. * ----------------------------------------------------------------------
  39. * @(1) Sort Column BLOCK And Adjacent Text In ASCENDING Absolute Value
  40. * ----------------------------------------------------------------------
  41. * This macro will sort an open or closed column block of entries and
  42. * adjacent text in ascending absolute value (by ASCII #) and right
  43. * justifies the sorted entries.
  44.  
  45. * Marking column 2 numbers as a column block:
  46. * vvvv
  47.  
  48. * 2      This
  49. * 2123   is
  50. * 12     a
  51. * 212    sort
  52. * 1      test.
  53.  
  54. * Becomes this:
  55.  
  56. *    1   test.
  57. *    2   This
  58. *   12   a
  59. *  212   sort
  60. * 2123   is
  61.  
  62. @1     macrobegin
  63.         setscreenoff
  64.         editfile "nul" return quit gotoblockbeg jfalse END editfile return
  65.         copyblock gotoblockend cursorleft addline #173 cursorup
  66. * -------------------------- Right justify --------------------------*
  67.   LOOP: unmarkblock markcolumn endline markcolumn
  68.         cut begline paste endline jtrue EMPTY gotoblockend
  69.  EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
  70.         unmarkblock markcolumn endfile cursorup markcolumn
  71. * --------------------------- Sort ascend ---------------------------*
  72.         cut quit pasteover onewindow sort unmarkblock
  73.    END:
  74. *
  75. * 57 bytes Wed  01-15-1992  15:02:52 (TH @F6)
  76. * 57 bytes Mon  04-20-1992  21:31:43 (TH @1)
  77. * 57 bytes Mon  04-20-1992  21:52:58 (TH @1)
  78.  
  79. * 
  80. * ----------------------------------------------------------------------
  81. * @(2) Sort Column BLOCK of Numbers And Adjacent Text
  82. *       In DESCENDING Absolute Value
  83. * ----------------------------------------------------------------------
  84. * This macro will sort an open or closed column block of numbers and
  85. * adjacent text in DESCENDING absolute value (by ASCII #) and right
  86. * justify the sorted numbers.  Qconfig unkill buffer must be set to 1
  87. * or more.  ASCII #173 must not exist in lines being sorted.  If you are
  88. * not using QEdit v2.15, remove setscreenoff line.
  89.  
  90. * Marking column 2 numbers as a column block:
  91. * vvvv
  92.  
  93. * 2      This
  94. * 2123   is
  95. * 12     a
  96. * 212    sort
  97. * 1      test.
  98.  
  99. * Becomes this:
  100.  
  101. * 2123   is
  102. *  212   sort
  103. *   12   a
  104. *    2   This
  105. *    1   test.
  106.  
  107. @2     macrobegin
  108.         setscreenoff
  109.         editfile "nul" return quit gotoblockbeg jfalse END editfile return
  110.         copyblock gotoblockend cursorleft addline #173 cursorup
  111. * -------------------------- Right justify --------------------------*
  112.   LOOP: unmarkblock markcolumn endline markcolumn
  113.         cut begline paste endline jtrue EMPTY gotoblockend
  114.  EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
  115.         unmarkblock markcolumn endfile cursorup markcolumn
  116.         cut quit pasteover insertline #173 onewindow sort
  117. * --------------------------- Sort descend ---------------------------*
  118.  AGAIN: gotoblockend jfalse MARK delline gotoblockbeg unkill jump AGAIN
  119.   MARK: find #173 return "b" return delline unmarkblock
  120.         makectrofscreen
  121.    END:
  122. *
  123. * 79 bytes Wed  01-15-1992  15:37:31 (TH @F7)
  124. * 79 bytes Mon  04-20-1992  21:52:47 (TH @2)
  125.  
  126. * 
  127. *----------------------------------------------------------------
  128. * @(3) Sort Column Block and Adjacent Text, Case Insensitive
  129. *----------------------------------------------------------------
  130. * This macro sorts a column block in ascending order and is case
  131. * INSENSITIVE.  We copy the sort key block, upper case it, and sort
  132. * the copy.  Then we delete the copy, leaving the original lines as
  133. * they were, except sorted:
  134.  
  135. *                         Before          After
  136. *                        ========        =======
  137. *                          abc             075
  138. *                          DEF             186
  139. *                          970             275
  140. *                          877             345
  141. *                          710             421
  142. *                          615             520
  143. *                          520             615
  144. *                          421             710
  145. *                          345             877
  146. *                          275             970
  147. *                          186             abc
  148. *                          075             DEF
  149.  
  150. @3      macrobegin
  151.         setscreenoff                    * Remove if not using QEdit v2.15
  152.         onewindow gotoblockbeg
  153.         copyblock jfalse END
  154.         upper sort deleteblock
  155.    END:
  156. *
  157. * 13 bytes Mon  08-20-1990  07:17:25 (TH @9)
  158. * 14 bytes Wed  12-11-1991  11:34:35 (TH @9, for v2.15)
  159. * 14 bytes Mon  04-20-1992  21:38:52 (TH @3)
  160.  
  161. * 
  162. * ----------------------------------------------------------------------
  163. * @(4) Sort Column Block and Adjacent Text In Descending Order, Fastest,
  164. *      Maximum Number of Lines Limited Only by Available Memory
  165. * ----------------------------------------------------------------------
  166. * This macro sorts an open or closed column block and all adjacent text
  167. * in Descending order.  The number of lines that can be sorted is
  168. * limited only by the available memory.
  169. *     - Operates irrespective of all toggles and qconfig settings
  170. *     - Remove setscreenoff if you are not using QEdit v2.15
  171. *     - Block must be an open or closed column block
  172. *     - Will not sort line or character block
  173. *     - Will not sort if Kill Buffer set to unerase zero lines
  174. *     - Will "reverse" sort by removing "sort jfalse delmrk" (See @8)
  175. *     - Does not add extra blank line if block ends at eof
  176. *     - ASCII #173 must not exist in sort block
  177. *     - Macro ends with cursor at block begin
  178.  
  179. *     Marking column 2 numbers as a column block:
  180. *     vvvv
  181.  
  182. *     2123   is
  183. *     212    sort
  184. *     2      This
  185. *     12     a
  186. *     1      test.
  187.  
  188. *     Becomes this:
  189.  
  190. *     2123   is
  191. *     212    sort
  192. *     2      This
  193. *     12     a
  194. *     1      test.
  195.  
  196. @4 macrobegin
  197.         setscreenoff                        * Remove if not using QEdit v2.15
  198.         horizontalwindow
  199.         editfile escape                     * For all Qconfig's            *|5
  200.         prevwindow                          * Close block if open
  201.         onewindow                           * Need for sort
  202.         gotoblockbeg jfalse end             * End macro if no block marked
  203.         insertline                          *ELSE insert line for pos marker
  204.         delline unkill jfalse end           * Test if unkill buff set >0,
  205.                                             * may remove line if unkill set >0
  206.         #173                                * Insert pos marker at block beg
  207.         sort                                * Sort ascending
  208.         jfalse delmark                      * If we can't sort, must not be a
  209.                                             * column block, del marker and end
  210. *       gotoblockend addline                * Need for blk that ends at eof*|1
  211.     again:
  212.         gotoblockend jfalse delblnk         * End macro when no more block
  213.         delline                             *ELSE delete next line
  214.         gotoblockbeg unkill                 * Unerase line at block beg
  215.         jump again                          * Loop 'till done
  216.     delblnk:
  217. *       cursordown delline                  * Delete extra blank line      *|2
  218.         cursordown                          * Test if block ended at eof   *|3
  219.         cursordown jtrue delmark delline    * Delete blank line if at eof  *|4
  220.     delmark:
  221.         find #173 return "b" return delline * Delete pos marker line
  222.     end:
  223.         unmarkblock                         * In case no marked column block
  224. *
  225. * 46 bytes Sun  12-15-1991  17:07:51 (TH @F4, to MH #22/4282)
  226. * 49 bytes Mon  12-16-1991  11:24:07 (TH @F5, rplc 1,2 w/3,4 for speed)
  227. * 49 bytes Mon  12-16-1991  11:24:07 (TH @F5, to MH #22/4304)
  228. * 49 bytes Mon  04-20-1992  21:35:17 (TH @F5)
  229. * 49 bytes Mon  04-20-1992  21:35:27 (TH @4)
  230. * 49 bytes Mon  04-20-1992  21:56:42 (TH @4)
  231. * 51 bytes Wed  05-13-1992  12:54:07 (TH @4, for all Qconfig's *|5)
  232.  
  233. * 
  234. * ---------------------------------------------------------------
  235. * @(5) Sort Column Block and Adjacent Text in Reverse Order,
  236. *      Maximum Number of Lines Limited Only by Available Memory
  237. * ---------------------------------------------------------------
  238. * This macro sorts a column block and text adjacent to the column block
  239. * in REVERSE order, not DESCENDING like @7, i.e.  The last column entry
  240. * becomes the first, and so on.  @5 has the same effect on text
  241. * adjacent to the column block as 'sort'.  Results are the same as if
  242. * the column block was an inverted one dimmensional matrix.
  243.  
  244. *                         Before          After
  245. *                        ========        =======
  246. *                          075             abc
  247. *                          186             DEF
  248. *                          275             970
  249. *                          345             877
  250. *                          421             710
  251. *                          520             615
  252. *                          615             520
  253. *                          710             421
  254. *                          877             345
  255. *                          970             275
  256. *                          DEF             186
  257. *                          abc             075
  258.  
  259. @5 macrobegin
  260.         setscreenoff                        * Remove if not using QEdit v2.15
  261.         horizontalwindow                    * Close block if open
  262.         editfile escape                     * For all Qconfig's            *|
  263.         onewindow                           * Need for sort
  264.         gotoblockbeg jfalse end             * End macro if no block marked
  265.         insertline                          * Insert line for pos marker
  266.         delline unkill jfalse end           *ELSE test if unkill buff set >0
  267.         #173                                * Insert pos marker at block beg
  268.     again:
  269.         gotoblockend jfalse testeof         * End macro when no more block
  270.         delline                             *ELSE delete next line
  271.         gotoblockbeg unkill                 * Unerase line at block beg
  272.         jump again                          * Loop 'till done
  273.     testeof:
  274.         cursordown cursordown jtrue delmark * Test if block ended at eof
  275.         delline                             *ELSE delete extra blank line
  276.     delmark:
  277.         find #173 return "b" return delline * Delete pos marker line
  278.     end:
  279.         unmarkblock                         * In case no block marked
  280. *
  281. * 43 bytes Sun  08-25-1991  17:23:40 (TH @8)
  282. * 52 bytes Mon  09-16-1991  22:20:14 (TH @8, for all Qconfig's)
  283. * 55 bytes Wed  12-11-1991  12:50:27 (TH @8, corrected for #'s in col 1)
  284. * 52 bytes Sat  12-14-1991  13:07:00 (TH @F4)
  285. * 48 bytes Sun  12-15-1991  10:53:10 (TH @8, used better alogrithm)
  286. * 44 bytes Mon  12-16-1991  11:33:03 (TH @8, like @F4 w/o first sort)
  287. * 44 bytes Mon  04-20-1992  21:39:55 (TH @5)
  288. * 46 bytes Wed  05-13-1992  12:57:30 (TH @5, for all Qconfig's)
  289.  
  290. * 
  291. * ----------------------------------------------------------------------------
  292. * @(6) Sort Column Block Only In Ascending Absolute Value,
  293. *      Adjacent Text Unchanged
  294. * ----------------------------------------------------------------------------
  295. * This macro sorts an open or closed column block of entries in
  296. * ascending absolute value (by ASCII #) and right justies the sorted
  297. * entries.  Will only sort single column, no adjacent text.
  298.  
  299. *     Marking numbers as a column block:
  300. *     vvvv
  301.  
  302. *     2      This
  303. *     2123   is
  304. *     12     a
  305. *     212    sort
  306. *     1      test.
  307.  
  308. *     Becomes this:
  309.  
  310. *        1   This
  311. *        2   is
  312. *       12   a
  313. *      212   sort
  314. *     2123   test.
  315.  
  316. @6      macrobegin
  317.         setscreenoff
  318.         editfile "nul" return quit gotoblockbeg jfalse END editfile return
  319.         copyblock gotoblockend cursorleft addline #173 cursorup
  320.   LOOP: unmarkblock markcolumn endline markcolumn
  321.         cut begline paste endline jtrue EMPTY gotoblockend
  322.  EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
  323.         unmarkblock markcolumn endfile cursorup markcolumn
  324.         onewindow sort cut quit pasteover unmarkblock
  325.    END:
  326. *
  327. * 47 bytes Sun  12-08-1991  12:00:16 (TH @2, to EW as @6 #20/24)
  328. * 57 bytes Tue  12-10-1991  13:40:16 (TH @5, made block para)
  329. * 56 bytes Tue  12-10-1991  22:00:34 (TH @5, changed to backspace)
  330. * 56 bytes Tue  12-10-1991  22:00:34 (TH @5, to EW #20/191, 1/13)
  331. * 55 bytes Tue  01-14-1992  17:45:47 (TH @5, handle blocks w/empty lines)
  332. * 55 bytes Tue  01-14-1992  17:45:47 (TH @5, to EW #20/198)
  333. * 56 bytes Tue  01-14-1992  20:20:44 (TH @5, to EW #20/199)
  334. * 57 bytes Wed  01-15-1992  22:22:28 (TH @5, added onewindow)
  335. * 57 bytes Tue  04-21-1992  10:50:44 (TH @6)
  336.  
  337. * 
  338. * ----------------------------------------------------------------------
  339. * @(7) Sort Only Column BLOCK of Numbers In DESCENDING Absolute Value
  340. * ----------------------------------------------------------------------
  341. * This macro will sort an open or closed column block of numbers in
  342. * DESCENDING absolute value (by ASCII #) and right justify the sorted
  343. * numbers.  Will only sort single column, no adjacent text.  If you are
  344. * not using QEdit v2.15, remove setscreenoff line.
  345.  
  346. * Marking column 2 numbers as a column block:
  347. * vvvv
  348.  
  349. * 2      This
  350. * 2123   is
  351. * 12     a
  352. * 212    sort
  353. * 1      test.
  354.  
  355. * Becomes this:
  356.  
  357. * 2123   This
  358. *  212   is
  359. *   12   a
  360. *    2   sort
  361. *    1   test.
  362.  
  363. @7      macrobegin
  364.         setscreenoff
  365.         editfile "nul" return quit gotoblockbeg jfalse END editfile return
  366.         copyblock gotoblockend cursorleft addline #173 cursorup
  367. * -------------------------- Right justify --------------------------*
  368.   LOOP: unmarkblock markcolumn endline markcolumn
  369.         cut begline paste endline jtrue EMPTY gotoblockend
  370.  EMPTY: cursorleft cursorup jtrue LOOP
  371.         begfile markcolumn endfile cursorup markcolumn
  372. * --------------------------- Sort descend ---------------------------*
  373.         onewindow sort
  374.  AGAIN: gotoblockend jfalse CONT delline gotoblockbeg unkill jump AGAIN
  375.   CONT: cursorleft markcolumn begfile cursorright
  376.         cut quit pasteover
  377.    END: unmarkblock
  378. *
  379. * 105 bytes Tue  12-10-1991  13:41:19 (TH @6, made block para)
  380. * 104 bytes Tue  12-10-1991  22:01:02 (TH @6, changed to backspace)
  381. * 104 bytes Sun  12-15-1991  11:31:11 (TH @6, better algorithm)
  382. * 104 bytes Sun  12-15-1991  11:31:11 (TH @6, to EW #20/191, 1/13)
  383. * 67 bytes Tue  01-14-1992  18:25:19 (TH @6, handle blocks w/empty lines)
  384. * 67 bytes Tue  01-14-1992  18:25:19 (TH @6, to EW #20/198)
  385. * 68 bytes Tue  01-14-1992  20:18:12 (TH @6, to EW #20/199)
  386. * 69 bytes Wed  01-15-1992  17:30:54 (TH @6, added onewindow)
  387. * 69 bytes Tue  04-21-1992  10:51:24 (TH @7)
  388.  
  389. * 
  390. * ----------------------------------------------------------------------
  391. * @(8) Sort Column Block Only In Ascending Order, Adjacent Text Unchanged
  392. * ----------------------------------------------------------------------
  393. * This macro sorts only the entries in an open or closed column block
  394. * in ascending order, leaving all text surrounding the column block in
  395. * the same position before and after.
  396.  
  397. @8      macrobegin
  398.         setscreenoff
  399.         editfile "nul" return quit gotoblockbeg jfalse END editfile return
  400.         moveblock onewindow sort cut quit paste unmarkblock
  401.    END:
  402. *
  403. * 27 bytes Thu  01-16-1992  09:25:43 (TH @0)
  404. * 27 bytes Tue  04-21-1992  10:55:22 (TH @8)
  405.  
  406. *     Marking numbers as a column block:
  407. *     vvvv
  408.  
  409. *     2      This
  410. *     2123   is
  411. *     12     a
  412. *     212    sort
  413. *     1      test.
  414.  
  415. *     Becomes this:
  416.  
  417. *     1      This
  418. *     12     is
  419. *     2      a
  420. *     212    sort
  421. *     2123   test.
  422.  
  423. * 
  424. * ----------------------------------------------------------------------
  425. * @(9) Sort Column Block Only In Descending Order, Adjacent Text Unchanged
  426. * ----------------------------------------------------------------------
  427. * This macro sorts only the entries in an open or closed column block
  428. * in descending order.  It leaves all text surrounding the column block
  429. * in the same position before and after.
  430.  
  431. * Marking column 2 numbers as a column block:
  432. * vvvv
  433.  
  434. * 2      This
  435. * 2123   is
  436. * 12     a
  437. * 212    sort
  438. * 1      test.
  439.  
  440. * Becomes this:
  441.  
  442. * 2123   This
  443. * 212    is
  444. * 2      a
  445. * 12     sort
  446. * 1      test.
  447.  
  448. @9 macrobegin
  449.         setscreenoff                       * Remove if not using QEdit v2.15
  450.         OneWindow
  451.         EditFile "NUL" Return Quit GoToBlockBeg JFalse ENDSORT
  452.         EditFile Return
  453.         MoveBlock
  454. *--- Reverse sort block only
  455.         Sort
  456.     again:
  457.         gotoblockend jfalse cont            * End macro when no more block
  458.         delline                             *ELSE delete next line
  459.         gotoblockbeg unkill                 * Unerase line at block beg
  460.         jump again                          * Loop 'till done
  461.     cont:
  462. *--- Make column block of widest entry
  463.         begfile
  464.      1: endline
  465.      2: cursorleft markcolumn cursordown jfalse 4
  466.      3: jump 1
  467.      4: delline
  468.         Cut Quit Paste unmarkblock
  469.  ENDSORT:
  470. *
  471. * 43 bytes Thu  08-15-1991  12:42:05 (TH @3)
  472. * 48 bytes Wed  12-11-1991  12:27:52 (TH @3, for all qconfig's)
  473. * 49 bytes Sun  12-15-1991  11:05:35 (TH @3, better algorithm)
  474. * 49 bytes Tue  04-21-1992  10:56:20 (TH @9)
  475.  
  476. * 
  477. * ----------------------------------------------------------------------
  478. * @(0) Randomly Sort a Column Block of Up to 999 Entries
  479. * ----------------------------------------------------------------------
  480. * To run, mark a column block to be randomly sorted, either open or
  481. * closed.  This macro will randomly sort up to 999 entries in a column
  482. * block and leave the text adjacent to the column block in it's
  483. * original position.  The results are the same as randomly sorting a
  484. * one dimmensional matrix composed of entries in the column block.
  485.  
  486. * A file named $rand containing numbers 1 to 999 randomly sorted is used
  487. * as the sorting key.  A temporary block containing both the block to
  488. * be sorted adjacent to the random numbers is sorted using the random
  489. * numbers as the sort key.  Thus, sorting the random numbers into an
  490. * ascending sorted set sorts the original marked block into a random
  491. * set.
  492.  
  493. * The file $rand must be present in the current directory and is
  494. * included in AMACxx.ZIp.  If $rand does not exist, it can easily be
  495. * made by first removing the asterisks and spaces in col 1 in the table
  496. * below, formatting the 999 random sorted numbers to a right margin
  497. * width of 4, and then saving the single column formatted numbers to a
  498. * file named $rand.
  499.  
  500. * As an example, col 1 when marked as an open or closed column block,
  501. * becomes randomly sorted as shown in col 2:
  502.  
  503. *                         Before          After
  504. *                        ========        =======
  505. *                          075             877
  506. *                          186             abc
  507. *                          275             275
  508. *                          345             970
  509. *                          421             345
  510. *                          520             615
  511. *                          615             075
  512. *                          710             710
  513. *                          877             186
  514. *                          970             421
  515. *                          abc             DEF
  516. *                          DEF             520
  517.  
  518. @0      macrobegin
  519.         setscreenoff                        * Remove if not using QEdit v2.15
  520.         onewindow
  521.         gotoblockbeg jtrue 1 markcolumn     * Close block                  *|
  522.         gotoblockbeg jtrue END
  523.      1: editfile "$rand" return             * Load random number file
  524.         begfile endline cursorright         * Position for block
  525.         moveblock                           * Move unsorted
  526.         gotoblockend unmarkblock
  527.         cursorleft markcolumn begfile       * Get random #'s in block
  528.         sort                                * Sort with random number key
  529.         wordright splitline endline         * Remove random #'s from block *|
  530.         cursorright joinline                *                              *|
  531.         cut quit                            * Cut block to scrap, quit RAND*|
  532.         paste                               * Paste random block back
  533.         unmarkblock
  534.    END:
  535. *
  536. * 33 bytes Sun  08-25-1991  13:52:16 (TH @4)
  537. * 46 bytes Fri  12-13-1991  10:16:12 (TH @4, quit if no block, quit $rand |)
  538. * 46 bytes Tue  04-21-1992  10:57:02 (TH @0)
  539.  
  540. * Numbers 001 to 999 Randomly Sorted
  541. * ---------------------------------
  542. * This table contains numbers 001 to 999 randomly sorted.  Statisticians
  543. * will argue this is not 'truly random' and it is not but it is
  544. * sufficiently random for our column block sorting purposes.  There are
  545. * no repeating numbers.  This Table is included as a single column file
  546. * $rand in AMACxx.ZIP.
  547.  
  548. * 487 671 332 471 727 897 478 551 054 371 080 856 987 821 634 338 937
  549. * 614 562 020 171 932 705 601 274 791 824 477 663 552 343 223 288 654
  550. * 273 205 945 480 317 533 903 685 740 725 187 017 722 560 530 842 087
  551. * 777 192 142 452 319 523 208 181 732 704 126 218 014 568 672 780 809
  552. * 517 033 365 940 883 430 024 215 750 426 380 347 774 606 314 433 009
  553. * 377 869 359 836 595 876 963 456 715 929 060 015 658 861 481 773 095
  554. * 799 674 217 212 182 984 018 804 174 151 993 771 520 335 778 386 388
  555. * 858 287 695 465 684 593 522 008 488 123 930 240 119 692 531 267 730
  556. * 437 483 406 472 770 188 742 516 027 905 264 250 807 374 494 915 969
  557. * 967 454 259 137 550 859 589 245 447 213 741 953 958 270 926 957 230
  558. * 952 475 801 868 253 285 921 466 702 130 204 302 819 041 237 282 016
  559. * 207 911 640 418 754 244 308 559 175 114 738 525 792 584 173 553 510
  560. * 950 147 720 779 894 539 977 994 597 411 030 068 665 912 655 689 604
  561. * 822 872 052 443 312 354 440 962 736 546 249 996 986 337 716 034 512
  562. * 134 760 942 381 504 895 128 301 339 619 113 368 825 916 358 254 395
  563. * 690 403 133 966 563 749 390 954 216 242 132 913 664 333 980 726 050
  564. * 112 315 307 449 693 622 806 349 476 887 227 631 382 823 366 444 698
  565. * 796 263 839 350 091 362 446 906 324 460 526 295 814 651 904 461 143
  566. * 981 659 458 177 850 002 805 121 591 127 412 345 222 029 931 110 457
  567. * 224 759 498 751 877 473 746 888 391 555 202 252 363 794 923 387 389
  568. * 509 629 649 164 956 357 160 865 524 628 998 209 180 396 818 681 084
  569. * 815 062 728 739 378 648 505 450 265 623 933 656 206 427 320 574 423
  570. * 492 612 990 666 064 239 178 679 639 183 144 025 844 766 299 556 860
  571. * 616 328 569 641 225 790 266 318 469 573 135 019 441 094 784 892 290
  572. * 321 118 072 511 697 831 808 482 834 548 734 896 420 083 012 590 294
  573. * 322 499 158 811 057 161 786 587 783 146 709 820 832 576 975 733 234
  574. * 255 131 501 810 917 537 138 214 246 982 257 286 088 907 099 355 645
  575. * 624 884 919 846 141 085 793 829 098 409 870 513 694 346 802 109 296
  576. * 617 199 944 714 721 081 871 642 003 683 341 262 280 719 021 983 788
  577. * 878 627 150 102 168 899 464 490 758 922 495 845 946 797 528 397 048
  578. * 067 547 544 340 231 163 170 585 660 854 691 961 139 069 269 789 900
  579. * 518 474 542 575 445 186 889 647 763 169 947 997 298 036 424 063 047
  580. * 251 326 610 643 848 491 276 948 497 538 626 361 309 379 195 633 172
  581. * 713 696 880 106 743 535 260 093 570 400 277 529 289 035 621 484 976
  582. * 191 717 241 800 369 652 124 837 179 413 653 891 762 583 637 198 686
  583. * 767 097 795 292 011 090 376 197 416 885 890 586 306 554 031 037 782
  584. * 863 038 108 840 404 600 724 785 851 422 079 572 442 991 699 949 185
  585. * 051 879 372 284 744 828 712 925 271 383 941 053 951 753 056 431 414
  586. * 233 023 066 293 935 167 272 703 417 010 602 247 909 070 210 965 875
  587. * 155 873 125 992 765 467 657 162 673 960 248 042 370 032 669 615 351
  588. * 618 902 221 843 635 103 540 502 830 157 152 236 256 219 752 040 866
  589. * 228 410 082 421 775 995 356 489 508 959 943 235 914 434 089 327 541
  590. * 360 493 781 156 661 076 682 934 189 149 352 813 166 936 567 978 988
  591. * 565 577 107 367 708 670 353 867 620 927 968 462 769 407 013 459 761
  592. * 201 920 373 688 862 402 608 316 527 772 707 855 632 939 148 581 325
  593. * 086 438 841 566 435 159 348 874 297 448 549 045 220 268 261 344 519
  594. * 468 078 129 756 401 005 607 331 073 419 184 096 582 545 405 729 100
  595. * 432 817 757 677 985 668 609 190 532 194 826 594 058 833 755 710 071
  596. * 979 881 864 662 028 893 193 092 342 507 625 238 074 882 075 455 588
  597. * 394 592 313 375 646 852 229 105 748 723 278 803 334 485 007 111 415
  598. * 731 598 506 928 989 711 910 291 596 901 580 898 768 700 678 203 500
  599. * 451 605 453 153 077 044 835 515 104 004 279 776 065 305 470 999 561
  600. * 857 101 258 399 364 243 816 039 955 329 061 116 310 908 747 043 281
  601. * 336 384 603 972 964 463 571 644 630 226 543 049 650 970 745 787 847
  602. * 176 115 924 812 001 534 687 122 503 667 232 735 304 579 154 398 557
  603. * 886 022 638 680 436 496 145 675 385 006 578 564 392 486 439 059 283
  604. * 211 737 849 429 974 971 136 514 200 718 558 536 599 165 300 701 140
  605. * 117 120 973 838 393 026 613 764 479 196 827 275 408 046 425 706 611
  606. * 311 676 055 918 303 323 938 428 330 636 521 853 798
  607.  
  608. * 
  609. * ----------------------------------------------------------------------
  610. * #(f1) Make Column Block to Test Macros
  611. * ----------------------------------------------------------------------
  612. * This is a macro to test the sorting macros.  Be sure there are at
  613. * least 6 blank lines to insert the marked column block.  Qconfig must
  614. * be set to shift blocks with Tab.  This macro inserts the following:
  615.  
  616. *     Marked
  617. *       vvv
  618.  
  619. *     A BB
  620. *     b aa
  621. *     C 1
  622. *     d 385
  623. *     E 173
  624.  
  625. *       ^^^
  626.  
  627. #f1     macrobegin
  628.         delline delline delline delline delline delline
  629.         "A BB" return "b aa" return "C 1" return "d 385" return "E 173" return
  630.         return prevpara unmarkblock markline endpara markline
  631.         prevpara begline wordright wordright tabrt
  632.         unmarkblock firstnonwhite wordright
  633.         markcolumn cursordown cursordown cursordown cursordown
  634.         cursorright cursorright markcolumn gotoblockbeg
  635. *
  636. * 80 bytes Wed  12-11-1991  16:06:05 (TH @F9)
  637. * 80 bytes Tue  04-21-1992  11:06:17 (TH #f1)
  638.  
  639. * 
  640. * ----------------------------------------------------------------------
  641. * #(f2) Technique to Test If Block Is Marked, and Close Block
  642. * ----------------------------------------------------------------------
  643. * This technique is a short quick way to to test if block is marked,
  644. * and close the block if it is open.
  645.  
  646. #f2        macrobegin
  647.            horizontalwindow
  648.            editfile escape                     * For all Qconfig's         *|
  649.            prevwindow onewindow
  650.            gotoblockbeg jfalse END
  651. *          <<< PROCESS BLOCK >>>
  652.     END:
  653. *
  654. * 11 bytes Mon  12-30-1991  11:36:56 (TH ^2)
  655. * 11 bytes Tue  04-21-1992  12:19:21 (TH #f2)
  656. * 13 bytes Wed  05-13-1992  12:58:54 (TH #f2, for all Qconfig's)
  657.  
  658. * 
  659. * ----------------------------------------------------------------------
  660. * #(f3) Convert Vertical to Horizontal Column Block,
  661. *       Horizontal Entries Separated by a Single Space
  662. * ----------------------------------------------------------------------
  663. * This macro converts a vertical column block to a horizontal single
  664. * line column block with horizontal entries separated by a single
  665. * space.  Block may be open or closed.
  666.  
  667. *     1 becomes 1 2 3
  668. *     2
  669. *     3
  670.  
  671. #F3     MacroBegin
  672.         OneWindow EditFile "NUL" Return Quit GotoBlockBeg jfalse END
  673.         HorizontalWindow EditFile Return MoveBlock
  674.   LOOP: EndLine
  675.         CursorRight CursorRight JoinLine CursorLeft DelRtWord jtrue LOOP
  676.         EndLine MarkCharacter Cut Quit PrevWindow OneWindow Paste
  677.    END: * UnmarkBlock
  678. *
  679. * 38 bytes Thu  08-15-1991  15:35:40 (TH #F3)
  680.  
  681. * 
  682. * ----------------------------------------------------------------------
  683. * #(f4) Convert Horizontal to Vertical Column Block,
  684. *       Horizontal Entries Separated by Space
  685. * ----------------------------------------------------------------------
  686. * This macro converts a horizontal single line column block, with
  687. * horizontal entries separated by a single space, to a vertical column
  688. * block.  Block may be open or closed.
  689.  
  690. *     1 2 3 becomes 1
  691. *                   2
  692. *                   3
  693.  
  694. #F4     MacroBegin
  695.         OneWindow AltWordSet EditFile "NUL" Return
  696.         Quit GotoBlockBeg jfalse END
  697.         HorizontalWindow EditFile Return MoveBlock UnmarkBlock WordRight
  698.   LOOP: EndLine Jfalse NEXT
  699.         PrevPosition CursorLeft DelCh SplitLine WordRight WordRight jump LOOP
  700.   NEXT: CursorLeft MarkColumn BegFile Cut Quit PrevWindow OneWindow Paste
  701.    END: DefaultWordSet * UnmarkBlock
  702. *
  703. * 47 bytes Thu  08-15-1991  15:36:00 (TH #F4)
  704.  
  705. * 
  706. * ----------------------------------------------------------------------
  707. * #(f5) Convert Vertical to Horizontal Column Block,
  708. *       Horizontal Entries NOT Separated by a Single Space
  709. * ----------------------------------------------------------------------
  710. * This macro converts a vertical column block to a horizontal single
  711. * line column block with horizontal entries NOT separated by a single
  712. * space.  Block may be open or closed.
  713.  
  714. *     1 becomes 123
  715. *     2
  716. *     3
  717.  
  718. #F5     MacroBegin
  719.         OneWindow EditFile "NUL" Return Quit GotoBlockBeg jfalse END
  720.         HorizontalWindow EditFile Return MoveBlock
  721.   LOOP: EndLine JoinLine jtrue LOOP
  722.         EndLine MarkCharacter Cut Quit PrevWindow OneWindow Paste
  723.    END: * UnmarkBlock
  724. *
  725. * 34 bytes Thu  08-15-1991  15:39:00 (TH #F5)
  726.  
  727. * 
  728. * ----------------------------------------------------------------------
  729. * #(f6) Convert Horizontal to Vertical Column Block,
  730. *       Horizontal Entries NOT Separated by Space
  731. * ----------------------------------------------------------------------
  732. * This macro converts a horizontal single line column block, with
  733. * horizontal entries NOT separated by a single space, to a vertical
  734. * column block.  Block may be open or closed.
  735.  
  736. *      123 becomes 1
  737. *                  2
  738. *                  3
  739.  
  740. #F6     MacroBegin
  741.         OneWindow EditFile "NUL" Return Quit GotoBlockBeg jfalse END
  742.         HorizontalWindow EditFile Return MoveBlock UnmarkBlock
  743.   LOOP: CursorRight SplitLine Begline CursorDown EndLine Jfalse NEXT
  744.         PrevPosition jump LOOP
  745.   NEXT: CursorUp BegLine MarkColumn BegFile Cut Quit PrevWindow OneWindow
  746.         Paste
  747.    END: * UnmarkBlock
  748. *
  749. * 44 bytes Thu  08-15-1991  15:40:21 (TH #F6)
  750.